package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.httpmodel.AnotherResult;
import com.quasar.hpatient.model.medicalmodel.DiagnosisData;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.viewInterface.UiInterface;

/**
 * author : 许建宏
 * Date: 2017/10/31 0031
 * View:
 */

public class DiagnosisDataPresenter {

    private RequestModel requestModel;
    private UiInterface<AnotherResult<DiagnosisData>> uiInterface;

    public DiagnosisDataPresenter(UiInterface<AnotherResult<DiagnosisData>> uiInterface) {
        this.requestModel = new RequestModel();
        this.uiInterface = uiInterface;
    }

//    public void PostDiagnosisData(String recordTime,String endTime){
//
//        requestModel.DiagnosisData(recordTime, endTime, new AnotherResultListener<AnotherResult<DiagnosisData>>() {
//            @Override
//            public void onSuccess(AnotherResult<DiagnosisData> data) {
//                uiInterface.onViewSuccess(data);
//            }
//
//            @Override
//            public void onError(String msg) {
//                uiInterface.onViewError(msg);
//            }
//
//            @Override
//            public void onRefreshUI() {
//                uiInterface.onViewRefreshUI();
//            }
//        });
//    }

    public void PostDiagnosisData(String recordTime){

//        requestModel.LXT_GetRecentDiagnoseListData(recordTime, new AnotherResultListener<AnotherResult<DiagnosisData>>() {
//            @Override
//            public void onSuccess(AnotherResult<DiagnosisData> data) {
//                uiInterface.onViewSuccess(data);
//            }
//
//            @Override
//            public void onError(String msg) {
//                uiInterface.onViewError(msg);
//            }
//
//            @Override
//            public void onRefreshUI() {
//                uiInterface.onViewRefreshUI();
//            }
//        });

        requestModel.QueryGetPatientDiagnoseLsitData(recordTime, new AnotherResultListener<AnotherResult<DiagnosisData>>() {
            @Override
            public void onSuccess(AnotherResult<DiagnosisData> data) {
                uiInterface.onViewSuccess(data);
            }

            @Override
            public void onError(String msg) {
                uiInterface.onViewError(msg);
            }

            @Override
            public void onRefreshUI() {
                uiInterface.onViewRefreshUI();
            }
        });
    }

}
